<template>
  <div>
    <!-- 放置一个svg的图标 -->
    <svg-icon
      icon-class="fullscreen"
      class="box_icon"
      @click="changeScreen"
    />
  </div>
</template>

<script>
import ScreenFull from 'screenfull'
export default {
  methods: {
    changeScreen() {
      if (!ScreenFull.isEnabled) {
        this.$message.warning('该界面不支持全屏')
        return
      }
      ScreenFull.toggle()
    }
  }
}
</script>

<style lang="scss" scoped>
.box_icon {
  color: #fff;
  width: 20px;
  height: 20px;
  margin: 16px 10px 0px;
  cursor: pointer;
}
</style>
